﻿@{
    if (false)
    {
        <script src="~/LiberUI/Scripts/jquery-2.0.3.js"></script>
        <script src="~/LiberUI/Scripts/jquery.ba-resize.js"></script>
        <script src="~/LiberUI/Scripts/LiberUI.Base.js"></script>
        <script src="~/LiberUI/Scripts/LiberUI.Controllers.js"></script>
        <script src="~/LiberUI/Scripts/LiberUI.Action.js"></script>
        <script src="~/LiberUI/Scripts/jquery.textSearch-1.0.js"></script>
    }
    <link href="~/SiteUI/Comment/Comment.css" rel="stylesheet" />
}

<div class="CommentViewer fladeInDown">
    <div class="cvPostInfo"></div>
    <div class="cvContent"></div>
</div>
<div id="txbNewComment">

</div>
<script>
    wgComment = {}
    wgComment.tplCmnt = $(".CommentViewer").hide().eq(0);

    wgComment.MakeComntView=function(_data) {
        var elm = wgComment.tplCmnt.clone();
        elm.children(".cvPostInfo").html(_data.Poster+" 回复于 "+_data.CreateTime);
        elm.children(".cvContent").html(unescape(_data.Content));
        return elm.show();
    };

    $(function () {
        wgComment.lstComments = new List(null,{ ShowHead: false, ShowNullTip: false,StyleForRow:'' });
        wgComment.lstComments.af_makeView = wgComment.MakeComntView;
        wgComment.txbNewComment = new HtmlEditor($("#txbNewComment"));
        //wgComment.txbNewComment.on('focus', function () { KeybordHelper.globalOn("ctrl+enter", wgComment.SubmitComment); });
        //wgComment.btnSubmitNewCmnt = new Button($("#btnSubmitNewCmnt")).on('click', wgComment.SubmitComment);

        wgComment.chkComment = new Validater({BlurOnErr:true,CheckOnBlur:false});
        wgComment.chkComment.NoEmpty(wgComment.txbNewComment, "", "评论内容不能为空");

        //KeybordHelper.globalOn("ctrl+enter", wgComment.SubmitComment);
    });
</script>
